<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateActivityDeliveriesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('activity_deliveries', function (Blueprint $table) {
            $table->uuid('id')->index();
            $table->uuid('user_id')->comment("用户id");
            $table->uuid('point_id')->comment("关联位置");//关联位置
            $table->string('name')->comment("规则名称");//规则名称
            $table->integer('platform')->comment("投放平台 二进制存储（1-JS 2-iOS 4-Android）");//投放平台
            $table->smallInteger('type')->default(1)->comment("投放类型 1-banner 2-启动页 3-信息流");//投放类型 1-banner 2-启动页 3-信息流
            $table->smallInteger('status')->default(2)->comment("投放状态 1-进行中 2-暂停");//投放状态 1-进行中 2-暂停
            $table->timestamps();
            $table->primary('id');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('activity_deliveries', function (Blueprint $table) {
            $table->dropIfExists();
        });
    }
}
